package com.cloudbroker.bcs.platform.ltb.middle.service.impl;

import com.cloudbroker.bcs.common.dao.base.DAOBase;
import com.cloudbroker.bcs.platform.ltb.common.config.ConfigValues;
import com.cloudbroker.bcs.platform.ltb.middle.dao.CustomerDAO;
import com.cloudbroker.bcs.platform.ltb.middle.entity.Customer;
import com.cloudbroker.bcs.platform.ltb.middle.service.CustomerService;
import com.cloudbroker.bcs.platform.ltb.middle.service.base.TenantServiceImplBase;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created by tianrui on 2016/7/5.
 */

@Service
public class CustomerServiceImpl
        implements CustomerService{

    @Resource
    private CustomerDAO customerDAO;

    @Override
    public void addCustomer(Customer customer) {
        customer.setMycat_flag(ConfigValues.getMycatFlag());
        customerDAO.addCustomer(customer);
    }

    @Override
    public long getCustomerID(Customer customer) {
        return customerDAO.getCustomerID(customer);
    }

    @Override
    public int getCustomerStatus(Customer customer) {
        return customerDAO.getCustomerStatus(customer);
    }

    @Override
    public Customer getCustomer(Customer customer) {
        return customerDAO.getCustomer(customer);
    }

    @Override
    public void updateCustomerName(Customer customer){
        customerDAO.updateCustomerName(customer);
    }

    @Override
    public void updateCustomerAvatar(Customer customer){
        customerDAO.updateCustomerAvatar(customer);
    }
}
